/**

 */

var showXHR;

function handleShowResult(doc)
{
	var fixURL1 = doc.split('show_id=');
	var fixURL2 = fixURL1[1].split('"');
	feed = "http://www.hulu.com/feed/show/"+fixURL2[0]+"/episodes";

	feedTitle = subsTitle.toUpperCase();
	doVideoLayout();
	
	var dctk = connected.toolkit;
	connected.debug.print("show = "+fixURL2[0]);
	
}

function startShowRequest()
{
    showXHR = new XMLHttpRequest();
    showXHR.onreadystatechange = onShowXHRStateChange;
    showXHR.open("GET", pageUrl[0], true);
	showXHR.overrideMimeType('text/xml');
    showXHR.send(null);
}

function onShowXHRStateChange()
{
    if (showXHR.readyState == 4)
    {
        if (showXHR.status == 200)
        {
            //findMedia(showXHR.responseXML);
			handleShowResult(showXHR.responseText);
        }
    }
}